﻿///<copyright>
/// Copyright © 2009 Stephen Styrchak. All Rights Reserved.
///</copyright>
using System;
using System.Windows.Forms;
using System.Windows.Forms.Design;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Ferpect.ComponentModel.Design
{
    public partial class ColorEditorDialog : Form
    {
        private IWindowsFormsEditorService editorService;
        private Color originalColor;

        public ColorEditorDialog()
        {
            InitializeComponent();
        }

        public ColorEditorDialog(Color colorValue, IWindowsFormsEditorService editorService)
            : this()
        {
            this.originalColor = colorValue;
            this.colorPickerControl1.Value = colorValue;
            this.editorService = editorService;
        }

        public Color Value
        {
            get
            {
                return this.colorPickerControl1.Value;
            }
            set
            {
                this.colorPickerControl1.Value = value;
            }
        }

        private void buttonOK_Click(object sender, EventArgs e)
        {
            ((Button)sender).Focus();
            this.Close();
        }

        private void buttonCancel_Click(object sender, EventArgs e)
        {
            this.Value = this.originalColor;
            this.Close();
        }
    }
}
